﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>修改密码</title>
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.custom.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/My97DatePicker/WdatePicker.js", true)" type="text/javascript"></script>


  
    @if (false)
    {
        <script src="../../../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript"></script>
    }
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#btnSave").button();
            $("#btnSave").bind("click", function () {           
                save();
            });
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
        });
        /*保存*/
        function save() {
            if (confirmSetNullPassword()) {
                form1.submit();
            }    
        }
        function  confirmSetNullPassword() {
            //让用户确认要把密码设置为空
            var newpassword = $.trim($('#txtPasswordNew').val());
            var newpasswordtwo = $.trim($('#txtPasswordNewTwo').val());
            if (newpassword != newpasswordtwo) {
                alert("两次输入的密码不一致，请重新输入");
                return false;
            }
            if (newpassword == "" && newpasswordtwo == "") {
                if (confirm("您确定要把密码设置为空吗？")) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                return true;
            }
        }
    </script>
</head>
<body>
 @using (Html.BeginForm("SavePassword", "User", FormMethod.Post, new { id = "form1" }))
 {
    <div>
       <table width="450px"  align="center" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <th width="110px" >
                    登录名：
                </th>
                <td >
                    @Html.TextBox("txtFLogID", ViewData["txtFLogID"], new { @style = "width:160px ;", @readonly = true })
                </td>
            </tr>
             <tr>
                <th width="110px" >
                    用户名称：
                </th>
                <td >
                    @Html.TextBox("textFName", ViewData["txtFName"], new { @style = "width:160px;", @readonly = true })
                </td>
            </tr>
            <tr>
                <th >
                    原密码：
                </th>
                <td>
                     @Html.Password("txtFPassword", "", new { @style = "width:160px;" })
                </td>
            </tr>
            <tr>
                <th>
                    新密码：
                </th>
                <td >
                     @Html.Password("txtPasswordNew", "", new { @style = "width:160px;" })
                </td>
            </tr>
            <tr>
                <th >
                    新密码确认：
                </th>
                <td >
                     @Html.Password("txtPasswordNewTwo", "", new { @style = "width:160px;" })
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                  <div style="padding: 0px; background: #efefef; width: 100%;">
                       <input type="button" id="btnSave" value="保存" />
                   </div>
            
                </td>
            </tr>
        </table>
    </div>
     @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));
 }
</body>
</html>
